package com.ruoyi.zxjd.demeanor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zxjd.demeanor.mapper.DemeanorProgressMapper;
import com.ruoyi.zxjd.demeanor.domain.DemeanorProgress;
import com.ruoyi.zxjd.demeanor.service.IDemeanorProgressService;
import com.ruoyi.common.core.text.Convert;

/**
 * 查看记录Service业务层处理
 * 
 * @author lcc
 * @date 2021-03-15
 */
@Service
public class DemeanorProgressServiceImpl implements IDemeanorProgressService 
{
    @Autowired
    private DemeanorProgressMapper demeanorProgressMapper;

    /**
     * 查询查看记录
     * 
     * @param progressId 查看记录ID
     * @return 查看记录
     */
    @Override
    public DemeanorProgress selectDemeanorProgressById(Long progressId)
    {
        return demeanorProgressMapper.selectDemeanorProgressById(progressId);
    }

    /**
     * 查询查看记录列表
     * 
     * @param demeanorProgress 查看记录
     * @return 查看记录
     */
    @Override
    public List<DemeanorProgress> selectDemeanorProgressList(DemeanorProgress demeanorProgress)
    {
        return demeanorProgressMapper.selectDemeanorProgressList(demeanorProgress);
    }

    /**
     * 新增查看记录
     * 
     * @param demeanorProgress 查看记录
     * @return 结果
     */
    @Override
    public int insertDemeanorProgress(DemeanorProgress demeanorProgress)
    {
        demeanorProgress.setCreateBy(ShiroUtils.getLoginName());
        demeanorProgress.setCreateTime(DateUtils.getNowDate());
        return demeanorProgressMapper.insertDemeanorProgress(demeanorProgress);
    }

    /**
     * 修改查看记录
     * 
     * @param demeanorProgress 查看记录
     * @return 结果
     */
    @Override
    public int updateDemeanorProgress(DemeanorProgress demeanorProgress)
    {
        demeanorProgress.setUpdateBy(ShiroUtils.getLoginName());
        demeanorProgress.setUpdateTime(DateUtils.getNowDate());
        return demeanorProgressMapper.updateDemeanorProgress(demeanorProgress);
    }

    /**
     * 删除查看记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDemeanorProgressByIds(String ids)
    {
        return demeanorProgressMapper.deleteDemeanorProgressByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除查看记录信息
     * 
     * @param progressId 查看记录ID
     * @return 结果
     */
    @Override
    public int deleteDemeanorProgressById(Long progressId)
    {
        return demeanorProgressMapper.deleteDemeanorProgressById(progressId);
    }
}
